{extend name="base" /}
{block name="css"}{/block}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post" enctype="">
            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" value="{$list.name|default=''}" autocomplete="off" placeholder="请输入名称" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">协议类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="contract_type" value="1" title="用户注册协议" checked>
                    <input type="radio" name="contract_type" value="2" title="支付服务协议" {if condition="isset($list.contract_type) AND $list.contract_type eq 2"}checked{/if}>
                    <input type="radio" name="contract_type" value="3" title="积分兑换协议" {if condition="isset($list.contract_type) AND $list.contract_type eq 3"}checked{/if}>
                    <input type="radio" name="contract_type" value="4" title="用户退换货协议" {if condition="isset($list.contract_type) AND $list.contract_type eq 4"}checked{/if}>
                    <input type="radio" name="contract_type" value="5" title="安全服务协议" {if condition="isset($list.contract_type) AND $list.contract_type eq 5"}checked{/if}>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block">
                  <textarea name="content" placeholder="请输入协议内容" id="editor" style="height:400px;">{$list.content|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
{block name='js'}
{js href="__AD_LIBS__/ueditor/ueditor.config.js,__AD_LIBS__/ueditor/ueditor.all.min.js,__AD_LIBS__/ueditor/lang/zh-cn/zh-cn.js" /}
<script>
layui.use(['form'], function () {
  var $ = layui.jquery;
  var layer = layui.layer;
  var form = layui.form;
  UE.getEditor('editor',{
      initialFrameWidth :'auto',// 设置编辑器宽度
      initialFrameHeight:400,// 设置编辑器高度
      scaleEnabled:true
  });
});
</script>
{/block}